console.log(123)

setTimeout(() => {
    console.log(2)
    console.log('hello')
}, 1000);

console.log(9)

//得到函数内部异步操作的结果：回调函数
// setTimeout
// readFile
// writeFile 
// ajax

function fn (x,y, callback) {
    setTimeout(() => {
        var ret = x + y
        callback(ret)
    }, 1000);
    
}

fn(10,20,function (ret) {
    console.log(ret)
})